<?php
include("../../tools/session.php");

// 如果登录成功
if ($is_login_success === true)
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="utf-8">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Content-Language" content="UTF-8" />
	<meta content="all" name="robots" />
	<meta name="author" content="tiger"/>
	<meta name="Copyright" content="jinzhou group" />
	<meta name="description" content="jinzhou group oa" />
	<title>文件上传</title>
	<link rel="stylesheet" type="text/css" href="../css/default/doc_template.css" />
</head>
<body>
  <form enctype="multipart/form-data" action="" method="POST">
    <input type="hidden" name="MAX_FILE_SIZE" value="100000" />
    选择文件: <input name="userfile" type="file" />
    <input type="submit" value="上传" />
</form>
<?php
  if (!empty($_FILES)){
      require_once('../../tools/upload.class.php');
      // $uploadpath = "../doc_tpl/" . date("Ym");
      // if (!file_exists($uploadpath)) { mkdir($uploadpath, 0777); }
      $uploadpath = "../doc_tpl";
      $f = new upfile($uploadpath, "gif,jpg,jpeg,png,bmp");
      if (isset($_FILES["userfile"])){
	  if ($f->upload("userfile")){
	      echo "上传成功！";
	      echo "<script language=\"javascript\">window.parent.upload_pic_succ('" . $uploadpath . "/" . $f->savename . "');</script>";
	  }
      }
  }
?>
</body>
</html>
<?php
}
// 如果登录失败或还未登录
else
{
   session_hop_page("../index.php");
   exit();
}
	  
?>
